﻿using CommandLine;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TextCopy;

namespace NK.Tools.Options
{
    [Verb("guid", HelpText = "Generate guid")]
    public class GuidTools : OptionHandlerBase
    {
        [Option('c', "count", Required = false, Default = 1, HelpText = "要生成的guid 的数量")]
        public int Count { get; set; }

        public override void HandleOption()
        {
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < Count; i++)
            {
                sb.AppendLine(Guid.NewGuid().ToString());
            }

            var result = sb.ToString();

            ClipboardService.SetText(result);

            Console.WriteLine("GUIDs已经复制到剪切板了。");
            Console.Write(result);
        }
    }
}
